<?php

if (!defined('BASEPATH'))
exit('No direct script access allowed');

/**
 * @author Anh Nguyen <duyanhnguyen@vccorp.vn>
 * @copyright 2012
 */

class Option_model extends CI_Model
{

    public function getOptionByName($name)
    {
        $name = trim($name);
        $this->db->select('value');
        $this->db->from('options');
        $this->db->where(array(
            'key'   =>  $name
        ));
        $rs = $this->db->get();
        if ($rs->num_rows != 0) {
            $return = $rs->result_array();
            $rs->free_result();
            return $return[0];
        }
        return false;
    }

}

?>
